var express = require('express');
var router = express.Router();
var user_controler=require('../controllers/user_controller');
var tokenValidate = require('../utils/tokenValidate');
router.get('/', function(req, res) {
  res.render('index', { title: 'Express' });
});
router.post('/checkUser',function (req,res) {
  user_controler.checkUser(req,res);
})
// 登录
router.post('/login',function (req,res) {
  user_controler.login(req,res);
})
// 退出登录
router.get('/logout', function(req, res){

});

// 获取用户信息
router.post('/getUserInfo',function (req,res,next) {
  //给路由添加登录验证
  tokenValidate.ValidateToken(req,res,function (data) {
    user_controler.getUserInfo(req,res,data);
  })
})



module.exports = router;
